{% extends 'myadmin/base.html' %}

{% block title %}
<title>Book-Shop-图书商品添加</title>
{% endblock %}

{% block con %}
<div class="row-content am-cf">


    <div class="row">

        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">图书商品添加表单</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">

                    <form class="am-form tpl-form-line-form" action="{% url 'myadmin_books_insert' %}" method="post" enctype="multipart/form-data">
                        {% csrf_token %}
                        <div class="am-form-group">
                            <label for="user-phone" class="am-u-sm-3 am-form-label">*所属分类(多选)</label>
                            <div class="am-u-sm-9">
                                <select name="typeid" multiple="multiple" data-am-selected="{searchBox: 0}" style="display: none;">
                                    {% for i in types %}
                                        <option value="{{i.id}}" {% if i.pid == 0 %} disabled {% endif %}}>{{i.sb}}{{i.name}}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>


                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">*书名</label>
                            <div class="am-u-sm-9">
                                <input type="text" name="title" required class="tpl-form-input">
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">*作者</label>
                            <div class="am-u-sm-9">
                                <input type="text" name="author" required class="tpl-form-input">
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">*出版社</label>
                            <div class="am-u-sm-9">
                                <input type="text" name="publisher" required class="tpl-form-input">
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">*出版时间</label>
                            <div class="am-u-sm-9">
                                <input type="date" name="pub_date" required class="tpl-form-input">
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">*ISBN书号</label>
                            <div class="am-u-sm-9">
                                <input type="number" name="ISBN" required maxlength="13" minlength="13" class="tpl-form-input">
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">*单价</label>
                            <div class="am-u-sm-9">
                                <input type="text" name="price" required class="tpl-form-input">
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">*库存数量</label>
                            <div class="am-u-sm-9">
                                <input type="number" name="num" required class="tpl-form-input">
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">*推荐语</label>
                            <div class="am-u-sm-9">
                                <textarea type="text" name="tuijian" required cols="30" rows="3">

                                </textarea>
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">*图书详情介绍</label>
                            <div class="am-u-sm-9">
                                <textarea name="context" id="" cols="30" rows="10">

                                </textarea>
                            </div>
                        </div>


                        <div class="am-form-group">
                            <label for="book-weibo" class="am-u-sm-3 am-form-label">图书封面</label>
                            <div class="am-u-sm-9">
                                <div class="am-form-group am-form-file">
                                    <div class="tpl-form-file-img">
                                    <!-- <img src="/static/myadmin/assets/img/a5.png" alt="">-->
                                    </div>
                                    <button type="button" class="am-btn am-btn-danger am-btn-sm">
                                        <i class="am-icon-cloud-upload"></i> 添加图书封面
                                    </button>
                                    <input id="doc-form-file" type="file" name="pic">
                                </div>
                            </div>
                        </div>




                        <div class="am-form-group">
                            <div class="am-u-sm-9 am-u-sm-push-3">
                                <button class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>


</div>


{% endblock %}

